package com.efast.dmom.mes.util;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class ClassUtils {
	public static ParameterizedType getParameterizedTypeByClass(Class<?> originalType) {
		Type superClassType = originalType.getGenericSuperclass();
		if (superClassType instanceof ParameterizedType) {
			return (ParameterizedType) superClassType;
		} else if (superClassType instanceof Class) {
			return getParameterizedTypeByClass((Class<?>) superClassType);
		}
		return null;
	}
}
